//
//  XOClubDetailCommentCell.m
//  didigo
//
//  Created by JS_Coder on 2019/3/2.
//  Copyright © 2019 lifayu. All rights reserved.
//

#import "XOClubDetailCommentCell.h"
#import "EJSClubCommentModel.h"
@interface XOClubDetailCommentCell()
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;
@property (weak, nonatomic) IBOutlet UILabel *commentName;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UIImageView *commentImageView;
@end

@implementation XOClubDetailCommentCell

- (void)setCommentModel:(EJSClubCommentModel *)commentModel {
    _commentModel = commentModel;
    [self setData];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setData {
    NSURL *imageUrl = [NSURL URLWithString: self.commentModel.user.avatar];
    [self.commentImageView sd_setImageWithURL:imageUrl placeholderImage:[UIImage imageNamed:@"02"]];
    
    self.contentLabel.text = self.commentModel.content;
    self.commentName.text = self.commentModel.user.name;

//    NSDateFormatter *fmt = [[NSDateFormatter alloc]init];
//    fmt.dateFormat = @"dd-MM-yyyy HH:mm:ss";
//    self.timeLabel.text = [fmt stringFromDate:[fmt dateFromString:self.commentModel.createTime]];
    self.timeLabel.text = self.commentModel.createTime;
}

@end
